package com.androidx.p013lv.invention.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.BoardListBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.invention.C1069R;
import com.androidx.p013lv.invention.view.FiveItemView;
import java.util.List;

/* renamed from: com.androidx.lv.invention.adapter.AdapterFive */
public class AdapterFive extends BaseRecyclerAdapter<BoardListBean, Holder> {
    String domain;
    Fragment fragment;

    public AdapterFive(List<BoardListBean> list, Fragment fragment2, String str) {
        this.list = list;
        this.fragment = fragment2;
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((BoardListBean) this.list.get(i), i);
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new Holder(LayoutInflater.from(viewGroup.getContext()).inflate(C1069R.C1074layout.item_five, viewGroup, false));
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.invention.adapter.AdapterFive$Holder */
    public class Holder extends BaseRecyclerHolder {
        TextView btn_more;
        ImageView iv_cover;
        LinearLayout ll_content;
        LinearLayout ll_item;
        TextView tv_title;

        public Holder(View view) {
            super(view);
            this.ll_content = (LinearLayout) view.findViewById(C1069R.C1072id.ll_content);
            this.btn_more = (TextView) view.findViewById(C1069R.C1072id.btn_more);
            this.tv_title = (TextView) view.findViewById(C1069R.C1072id.tv_title);
            this.btn_more.setOnClickListener(this);
            this.iv_cover = (ImageView) view.findViewById(C1069R.C1072id.iv_cover);
            this.ll_item = (LinearLayout) view.findViewById(C1069R.C1072id.ll_item);
            this.tv_title.setOnClickListener(this);
        }

        public void setData(BoardListBean boardListBean, int i) {
            this.tv_title.setText(boardListBean.getBoardName());
            Fragment fragment = AdapterFive.this.fragment;
            GlideUtils.loadPicWh2(fragment, AdapterFive.this.domain + boardListBean.getBgImg(), this.iv_cover, 600);
            this.ll_content.removeAllViews();
            int i2 = 0;
            while (i2 < boardListBean.getListVideo().size() && i2 <= 2) {
                this.ll_content.addView(new FiveItemView(AdapterFive.this.fragment, boardListBean.getListVideo().get(i2), AdapterFive.this.domain, i2));
                i2++;
            }
            LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) this.ll_item.getLayoutParams();
            if (i == 0) {
                layoutParams.leftMargin = UiUtils.dp2px(12);
            } else {
                layoutParams.leftMargin = 0;
            }
            this.ll_item.setLayoutParams(layoutParams);
        }
    }
}
